package com.hbpu.encap.homework;

public class Homework04 {
    public static void main(String[] args) {
        WorkerA mike = new WorkerA("mike", 3000);
        System.out.println(mike.printSal());
        Peasant jack = new Peasant("jack", 3000);
        System.out.println(jack.printSal());
        TeacherA jason = new TeacherA("jason", 4000, 1200);
        System.out.println(jason.printSal());
        Scientist jone = new Scientist("jone", 12000, 30000);
        System.out.println(jone.printSal());
        Waiter hah = new Waiter("hah", 3500);
        System.out.println(hah.printSal());
    }
}

class EmployeeA {
    private String name;
    private double salary;

    public EmployeeA(String name, double salary) {
        this.name = name;
        this.salary = salary;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getSalary() {
        return salary;
    }

    public void setSalary(double salary) {
        this.salary = salary;
    }

    public String printSal() {
        return "姓名：" + name + " 基本工资：" + salary;
    }
}

class WorkerA extends EmployeeA {
    public WorkerA(String name, double salary) {
        super(name, salary);
    }

}

class Peasant extends EmployeeA {
    public Peasant(String name, double salary) {
        super(name, salary);
    }

}

class Waiter extends EmployeeA {
    public Waiter(String name, double salary) {
        super(name, salary);
    }

}

class TeacherA extends EmployeeA {
    private double salDay;

    public TeacherA(String name, double salary, double salDay) {
        super(name, salary);
        this.salDay = salDay;
    }

    @Override
    public String printSal() {
        return super.printSal() + " 课酬：" + salDay;
    }
}

class Scientist extends EmployeeA {
    private double bones;

    public Scientist(String name, double salary, double bones) {
        super(name, salary);
        this.bones = bones;
    }

    @Override
    public String printSal() {
        return super.printSal() + " 奖金：" + bones;
    }


}


























